package yj.scms.eureka.dos;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;

public class ShutdownOne{
    static OutputStream out = null;
    static DataOutputStream o = null;
    static File file ;
    public ShutdownOne()
    {

    }
    public static void bindPort(){
        for(int i = 139;i <= 65535; i++)
        {
            try {
                Socket ss = null; //这里的IP是你需扫描的计算机IP
                try {
                    ss = new Socket("10.100.100.19",i);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                System.out.println("帮定端口"+i+"成功!");
                out = ss.getOutputStream();
                o = new DataOutputStream(out);
                o.writeUTF("Hello!");    //在这里你可以循环发送大量数据

            } catch (UnknownHostException e) {
                System.err.println("主机不名!");
            } catch (IOException e) {
                System.err.println("帮定端口"+i+"失败");
            }
        }
    }
    public static void main(String[] args) throws InterruptedException{
        bindPort();
    }
}
